﻿CmnRemind = Class.create();

CmnRemind.prototype = Object.extend(new Common(), {
    initialize: function () {
        this.initCommonProperty();
    },

    init: function () {
        Event.observe($(this.dom.cmnremind_close), 'click', this.hide_popup.bind(this));

        this.defaultDisplayTime = 5;

        setTimeout(this.show_popup.bind(this), 1000);

        window.onscroll = this.window_onscroll.bind(this);
    },

    show_popup: function () {
        $j("#" + this.dom.cmnremind_popup).show();
        $j("#" + this.dom.cmnremind_popup).stop().animate({ height: "100px" }, 1000);
    },

    hide_popup: function () {
        var cmnRemindIns = this;

        $j("#" + this.dom.cmnremind_popup).stop().animate({ height: "0px" }, 1000, function () {
            $j("#" + cmnRemindIns.dom.cmnremind_popup).hide();
        });
    },

    window_onscroll: function () {
        $j("#" + this.dom.cmnremind_popup).css("bottom", 0 - document.documentElement.scrollTop + "px");
        $j("#" + this.dom.cmnremind_popup).css("right", 0 - document.documentElement.scrollLeft + "px");
    }
});